home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 261 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: newsserver.rrzn.uni-hannover.de!tubsibr!duening
  2. From: duening@ibr.cs.tu-bs.de (Lars Duening)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 5 Jan 1996 14:48:45 GMT
  6. Organization: TU Braunschweig, Informatik (Bueltenweg), Germany
  7. Distribution: world
  8. Message-ID: <4cjdod$j0t@ra.ibr.cs.tu-bs.de>
  9. References: <john.hendrikx.40ka@grafix.xs4all.nl> <4b77tq$htp@serpens.rhein.de> <MQAQx*XOe@yaps.rhein.de> <4bqhnf$6g5@sunsystem5.informatik.tu-muenchen.de> <jasonb.820051107@cs.uwa.edu.au> <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de> <4cf0ep$233@ra.ibr.cs.tu-bs.de> <4cgo3i$b8n@sunsystem5.informatik.tu-muenchen.de>
  10. Reply-To: duening@ibr.cs.tu-bs.de (Lars Duening)
  11. NNTP-Posting-Host: kastor.ibr.cs.tu-bs.de
  12.  
  13. In article <4cgo3i$b8n@sunsystem5.informatik.tu-muenchen.de> fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) writes:
  14. >Lars Duening (duening@ibr.cs.tu-bs.de) wrote:
  15. >
  16. >: That doesn't count because in C you don't need to know if this statement
  17. >: compiles to a .w, to a .l or even to a .q .
  18. >
  19. >but when the .l meets a real-world color-register, you will notice
  20. >your claim is not always true.
  21.  
  22. If a have to access hardware registers (never had to so far), I will
  23. not do this by direct pointers, but instead define a structure
  24. representing them. This is then the only place where I have to worry
  25. about .c, .w and .l, everywhere else I can write 
  26. 'chipregs->blt0con = *b++;' and let the compiler figure the rest out.
  27. HLLs win again here: the compiler will warn if *b is of the wrong
  28. type, and if I defined the structure wrong (your .w/.l example), I
  29. just have to correct the structure, not the n statements where it is
  30. used. And the compiler would even take care of bitshifts where
  31. necessary.
  32.  
  33. Your 'move.w (a0)+,(a1)+' doesn't tell you if the '.w' is correct or
  34. not, unless you read the context and discover that a1 points to the
  35. chip registers. It doesn't tell you either if the data pointed to by (a0)
  36. is organized in words or in longwords - it just assumes that it is
  37. organized in words.
  38. -- 
  39. Lars Duening; duening@ibr.cs.tu-bs.de
  40.